<?php

require_once(CORE_DIR.'components/phpfastcache/phpfastcache.php');

class cacheComponent {

	public static $cache;

	public static function init($type,$path)
	{
		phpFastCache::setup("storage",$type);
		phpFastCache::setup("path", $path);
		self::$cache = phpFastCache();
	}

	public static function getPath()
	{
		return self::$cache->getPath();
	}

	public static function get($key)
	{
		return self::$cache->get($key);
	}

	public static function set($key,$data,$time)
	{
		return self::$cache->set($key,$data,$time);
	}

	public static function getInfo($key)
	{
		return self::$cache->getInfo($key);
	}

	public static function clean()
	{
		return self::$cache->clean();
	}

	public static function remove($key)
	{
		return self::$cache->delete($key);
	}

	public static function stats()
	{
		return self::$cache->stats();
	}

	public static function exist($key)
	{
		return self::$cache->isExisting($key);
	}

	public static function increment($key,$step)
	{
		return self::$cache->increment($key,$step);
	}

	public static function decrement($key,$step)
	{
		return self::$cache->decrement($key,$step);
	}

	public static function touch($key,$time)
	{
		return self::$cache->touch($key,$time);
	}

	public static function setMulti($list_key)
	{
		return self::$cache->setMulti($list_key);
	}

	public static function getMulti($list_key)
	{
		return self::$cache->getMulti($list_key);
	}

	public static function getInfoMulti($list_key)
	{
		return self::$cache->getInfoMulti($list_key);
	}

	public static function deleteMulti($list_key)
	{
		return self::$cache->deleteMulti($list_key);
	}

	public static function existMulti($list_key)
	{
		return self::$cache->isExistingMulti($list_key);
	}

	public static function incrementMulti($list_key)
	{
		return self::$cache->incrementMulti($list_key);
	}

	public static function decrementMulti($list_key)
	{
		return self::$cache->decrementMulti($list_key);
	}

	public static function touchMulti($list_key)
	{
		return self::$cache->touchMulti($list_key);
	}

}